<?php

class LoginView {

	private $Username = "username";
	private $Password = "password";
	private $LoginButton = "loginbutton";
	private $LogOutButton = "logoutbutton";
	
	public function DoLoginBox() {
		//returnerar login rutan .. 
		return "
		<form method='get' class='login'> 
	    	<fieldset >
	    		User name: <input type='text' name='$this->Username' /><br />
        		Password..: <input type='password' name='$this->Password' /><br />
	       
	   			<input type='submit' name='$this->LoginButton' value='Login' style='float:left;' />
	   				<input type='checkbox' style='margin-left: 22px;' name='Remember' value='Remember' /> Remember me
	   	</form>";
  	}
	
	
	public function DoLogoutBox() {
		//returnerar en logga ut knapp ..
	    return "
	    	<form name='input' method='get'> 
	    		</br><input type='submit' name='$this->LogOutButton' value='LogOut' style='float: left;' />
	    	</form>
	    </fieldset>";
	    
  	}
	
	
  	public function GetUserName(){
 
       if (isset( $_GET[$this->Username]) == true) {
      		return $_GET[$this->Username];
		}
		return null;
        
  	}
 
  	public function GetPassword(){
        if (isset( $_GET[$this->Password]) == true) {
      		return $_GET[$this->Password];
  		}
	    else {
			return null;
        }
  	}
 
  	public function TriedToLogIn(){
        if (isset( $_GET[$this->LoginButton]) == true) {
      		return true;
    	}
        return false;
        
	}
	public function TriedToLogOut(){
        if (isset( $_GET[$this->LogOutButton]) == true) {
      		return true;
    	}
	    return false;
        
  	}
}
